<?php session_start();
if($_SESSION['id_tipo_usuario']==1 AND $_SESSION['id_usuario']){

require_once '../framework/fw.php';	
require '../view/b_camaView.php';
require '../view/success_b_camaView.php';
require '../model/Cama.php';



if($_POST['envio']){
	$id_cama = $_POST['id_cama'];	
	$cama = new Cama;
	$cama->del_cama($id_cama);
	$pagina = new success_b_camaView;

}
else
if($_GET['id_cama'])
{	
	$id_cama = $_GET['id_cama'];
	$pagina = new b_camaView;
	$pagina->array_registro[] = array(id_cama=>$id_cama);
}
else
{
	echo "datos ingresados incorectos";
	$pagina = new b_camaView;	
}
$pagina->Render();
}

else{	session_destroy();
	header("location: clinica.htm");
}
?>